{include file="public/head" /}
<!--有理想的地方，地狱都是天堂-->
<!--Copyright @ df81.com 版权所有-->
<!--作者: 南国老符 邮箱：1062129401@qq.com-->
        <!-- 左侧菜单 开始 -->
        <div class="sidebar">
            <nav>
                <ul class="nav nav-pills nav-sidebar flex-column nav-flat nav-legacy" data-widget="treeview" role="menu" data-accordion="false">
                    {include file="public/left_content" /}
                </ul>
                <ul class="nav nav-pills nav-sidebar flex-column nav-flat nav-legacy d-block d-md-none" data-widget="treeview" role="menu" data-accordion="false">
                    {include file="public/left_data" /}
                </ul>
                <ul class="nav nav-pills nav-sidebar flex-column nav-flat nav-legacy d-block d-md-none" data-widget="treeview" role="menu" data-accordion="false">
                    {include file="public/left_global" /}
                </ul>
                <ul class="nav nav-pills nav-sidebar flex-column nav-flat nav-legacy d-block d-md-none" data-widget="treeview" role="menu" data-accordion="false">
                    {include file="public/left_system" /}
                </ul>
            </nav>
        </div>
        <!-- 左侧菜单 结束 -->
    </aside>
    <!-- 左侧 结束 -->
    <!-- 右侧 开始 -->
    <div class="content-wrapper">
        <!-- 内容导航 开始 -->
        <div class="content-header py-2 bg-white mb-3">
            <div class="container-fluid">
                <div class="row">
                    <div class="col-sm-12">
                        <ol class="breadcrumb">
                            <li>{:lang('v_home')}<i class="fas fa-angle-right mx-2"></i></li>
                            <li>{$mRs.title} {:lang('v_manage')}<i class="fas fa-angle-right mx-2"></i></li>
                            <li>{$mRs.title} {:lang('v_manage')}</li>
                        </ol>
                    </div>
                </div>
            </div>
        </div>
        <!-- 内容导航 结束 -->
        <!-- 内容主体 开始 -->
        <section class="content">
            <div class="container-fluid">
                <div class="row">
                    <div class="col-md-12">
                        <div class="card">
                            <div class="card-body">
                                <div class="w-100 mb-3">
                                    <form name="form_keyword" action="{:url('/product/index',['lang'=>$lang,'tabledir'=>input('tabledir'),'signid'=>input('signid')])}" method="post" class="row">
                                        <input type="hidden" name="lang" value="{$lang}">
                                        <input type="hidden" name="tabledir" value="{:input('tabledir')}">
                                        <div class="col-md-8 px-2">
                                            <a class="btn mb-2 mr-2 {if input('signid') eq 1 or empty(input('signid'))}btn-success{else /}btn-default{/if}" href="{:url('/product/index',['lang'=>$lang,'tabledir'=>input('tabledir'),'signid'=>1])}"><i class="fa fa-fw fa-list-ul mr-1"></i>{$mRs.title} {:lang('v_manage')}</a>
                                            <a class="btn mb-2 mr-2 {if input('signid') eq 9}btn-success{else /}btn-default{/if}" href="{:url('/product/index',['lang'=>$lang,'tabledir'=>input('tabledir'),'signid'=>9])}"><i class="fa fa-fw fa-recycle mr-1"></i>{:lang('v_recycle')}</a>
                                            <a class="btn mb-2 btn-default" href="{:url('/product/edit',['lang'=>$lang,'tabledir'=>input('tabledir')])}"><i class="fa fa-fw fa-plus-circle mr-1"></i>{:lang('v_add')} {$mRs.title}</a>
                                        </div>
                                        <div class="col-md-4 px-2">
                                            <div class="input-group">
                                                <input name="keyword" placeholder="{:lang('v_quickfind')}" type="text" class="form-control">
                                                <span class="input-group-append">
                                                    <select name="sortid" class="btn btn-default">
                                                        <option value="" {if empty(input('sortid'))}selected="selected"{/if}>{:lang('v_all')} {:lang('v_sort')}</option>
                                                        {tag:list name="sortRs" table="sort" where="lang='$lang' and tabledir='$tabledir' and parentid=0" limit="30" order="sequence desc"}
                                                            <option value="{$sortRs.id}" {if input('sortid') eq $sortRs.id}selected="selected"{/if}>{$sortRs.title}</option>
                                                        {/tag:list}
                                                    </select>
                                                    <button type="submit" class="btn btn-success"><i class="fa fa-search mr-1"></i>{:lang('v_search')}</button>
                                                </span>
                                            </div>
                                        </div>
                                    </form>
                                </div>
                                {php}$isdisplay_array=explode(',',$navModuleRs['isdisplay']);{/php}
                                <table class="table table-striped table-bordered table-hover">
                                    <form name="form_list" id="form_list" action="" method="post">
                                        <tr>
                                            <th width="100" class="text-center">ID</th>
                                            <th width="100" class="text-center d-invisible">{:lang('v_img')}</th>
                                            {in name="'sort'" value="$isdisplay_array"}<th class="d-invisible">{:lang('v_sort')}</th>{/in}
                                            <th>{:lang('v_title')}</th>
                                            {if config('app.other.system_type') neq 'company'}
                                                <th>{:lang('v_price')}</th>
                                            {/if}
                                            <th width="150" class="text-center d-invisible">{:lang('v_sequence')}</th>
                                            <th width="80" class="text-center">{:lang('v_status')}</th>
                                            <th width="280" class="text-center">{:lang('v_do')}</th>
                                        </tr>
                                        {volist name="list" id="rs"}
                                            {php}$tagsArr = explode(PHP_EOL,$rs['tags']);{/php}
                                            <input type="hidden" name="id[]" value="{$rs.id}" />
                                            <tr>
                                                <td class="text-center">
                                                    <label class="form-check form-check-inline">
                                                        {notin name="rs.id" value="$navModuleRs.no_deleteid"}
                                                            <input type="checkbox" name="selectid[]" id="selectid" value="{$rs.id}" class="mr-1" />
                                                        {/notin}
                                                        <span class="d-invisible">{$rs.id}</span>
                                                    </label>
                                                </td>
                                                <td class="text-center d-invisible">
                                                    <div style="max-height: 35px; overflow: hidden;">
                                                        <a href="/api/common/view.html?lang={$lang}&thumb={$rs.thumb}" data-target="#modal" data-toggle="modal">
                                                            <img src="{$rs.thumb}" width="70" onerror="this.src='{:config('template.skin')}/img/nopic.png'" />
                                                        </a>
                                                    </div>
                                                </td>
                                                {in name="'sort'" value="$isdisplay_array"}
                                                    <td class="d-invisible">
                                                        {$rs.s_title}
                                                    </td>
                                                {/in}
                                                <td>
                                                    <input name="title[]" type="text" value="{$rs.title}" class="form-control" />
                                                </td>
                                                {if config('app.other.system_type') neq 'company'}
                                                <td class="text-danger">
                                                    &yen; {:str_replace('.00','',$rs.price)}
                                                </td>
                                                {/if}
                                                <td class="text-center d-invisible">
                                                    <input name="sequence[]" type="text" value="{$rs.sequence}" class="input" size="5" />
                                                </td>
                                                <td class="text-center">
                                                    {switch rs.signid}
                                                        {case 1}
                                                            <span onClick="javascript:do_ajax('','','{:url('/module/table_update_signid',['lang'=>$lang,'id'=>$rs['id'],'signid'=>2,'tabledir'=>$tabledir])}','');" class="badge badge-success px-2 py-1 cursor">{:lang('v_show')}</span>
                                                        {/case}
                                                        {case 2}
                                                            <span onClick="javascript:do_ajax('','','{:url('/module/table_update_signid',['lang'=>$lang,'id'=>$rs['id'],'signid'=>1,'tabledir'=>$tabledir])}','');" class="badge badge-primary px-2 py-1 cursor">{:lang('v_no_sale')}</span>
                                                        {/case}
                                                    {/switch}
                                                    {if $rs.signid > 9}
                                                        <span class="badge badge-secondary px-2 py-1 cursor">{:lang('v_recycle')}</span>
                                                    {/if}
                                                </td>
                                                <td class="text-center">
                                                    <!-- 编辑 -->
                                                    <a class="btn btn-sm btn-info" href="{:url('/product/edit',['lang'=>$lang,'tabledir'=>input('tabledir'),'id'=>$rs['id']])}"><i class="fa fa-fw fa-edit mr-1"></i>{:lang('v_edit')}</a>
                                                    {switch signid}
                                                        {case 9}
                                                            <!-- 回收站 -->
                                                            <!-- 恢复 -->
                                                            <span onClick="javascript:do_ajax('','','{:url('/module/table_update_signid',['lang'=>$lang,'id'=>$rs['id'],'signid'=>1,'tabledir'=>input('tabledir')])}','');" class="btn btn-sm btn-purple mx-2"><i class="fa fa-fw fa-reply-all mr-1"></i>{:lang('v_restore')}</span>
                                                            {in name="rs.id" value="$navModuleRs.no_deleteid"}
                                                                <span class="btn btn-sm btn-secondary disabled"><i class="fa fa-fw fa-ban mr-1"></i>{:lang('v_cannot_delete')}</span>
                                                            {else /}
                                                                <!-- 真实删除 -->
                                                                <span onClick="javascript:do_confirm('','','{:url('/module/table_delete_one',['lang'=>$lang,'id'=>$rs['id'],'tabledir'=>input('tabledir')])}','','');" class="btn btn-sm btn-danger"><i class="fa fa-fw fa-trash mr-1"></i>{:lang('v_delete')}</span>
                                                            {/in}
                                                        {/case}
                                                        {default /}
                                                            <!-- 复制 -->
                                                            <span onClick="javascript:do_ajax('','','{:url('/module/copyinfo',['lang'=>$lang,'id'=>$rs['id'],'tabledir'=>$tabledir])}','');" class="btn btn-sm btn-warning mx-2"><i class="fa fa-fw fa-copy mr-1"></i>{:lang('v_copy')}</span>
                                                            {in name="rs.id" value="$navModuleRs.no_deleteid"}
                                                                <span class="btn btn-sm btn-secondary disabled"><i class="fa fa-fw fa-ban mr-1"></i>{:lang('v_cannot_delete')}</span>
                                                            {else /}
                                                                <!-- 软删除 -->
                                                                <span onClick="javascript:do_ajax('','','{:url('/module/table_update_signid',['lang'=>$lang,'id'=>$rs['id'],'signid'=>9,'tabledir'=>$tabledir])}','');" class="btn btn-sm btn-danger"><i class="fa fa-fw fa-trash mr-1"></i>{:lang('v_delete')}</span>
                                                            {/in}
                                                    {/switch}
                                                </td>
                                            </tr>
                                        {/volist}
                                        <tr>
                                            <td colspan="8">
                                                <div class="row">
                                                    <div class="col-xl-6 mt-2"><div class="float-lg-left mr-4">{$list->render()|raw}</div><div class="float-lg-left">{:lang('v_total')} {$lastPage} {:lang('v_page')} {$total} {:lang('v_records')}</div></div>
                                                    <div class="col-xl-6 mt-2 mt-md-1">
                                                        <div class="float-left float-xl-right">
                                                            <!-- 全选 -->
                                                            <button type="button" class="btn btn-info mr-2 checkbox-toggle"><i class="far fa-fw fa-square mr-1"></i>{:lang('v_select_all')}</button>
                                                            <!-- 更新 -->
                                                            <button type="button" class="btn btn-warning mr-2" onClick="javascript:do_ajax('#form_list','','{:url('/module/table_update_all',['lang'=>$lang,'tabledir'=>input('tabledir')])}','');"><i class="fa fa-fw fa-sync-alt mr-1"></i>{:lang('v_batch')} {:lang('v_update')}</button>
                                                            {switch signid}
                                                                {case 9}
                                                                    <!-- 回收站 -->
                                                                    <!-- 恢复 -->
                                                                    <button type="button" class="btn btn-purple mr-2" onClick="javascript:do_ajax('#form_list','','{:url('/module/table_update_all_signid',['lang'=>$lang,'signid'=>1,'tabledir'=>input('tabledir')])}','');"><i class="fa fa-fw fa-reply-all mr-1"></i>{:lang('v_restore_select')}</button>
                                                                    <!-- 真实删除 -->
                                                                    <button type="button" class="btn btn-danger" onClick="javascript:do_confirm('#form_list','','{:url('/module/table_delete_all',['lang'=>$lang,'tabledir'=>input('tabledir')])}','','');"><i class="fa fa-fw fa-trash mr-1"></i>{:lang('v_delete_select')}</button>
                                                                {/case}
                                                                {default /}
                                                                    <!-- 设为已审 -->
                                                                    <button type="button" class="btn btn-success mr-2" onClick="javascript:do_ajax('#form_list','','{:url('/module/table_update_all_signid',['lang'=>$lang,'signid'=>1,'tabledir'=>$tabledir])}','');"><i class="fa fa-fw fa-check-circle mr-1"></i>{:lang('v_sale_select')}</button>
                                                                    <!-- 设为待审 -->
                                                                    <button type="button" class="btn btn-primary mr-2" onClick="javascript:do_ajax('#form_list','','{:url('/module/table_update_all_signid',['lang'=>$lang,'signid'=>2,'tabledir'=>$tabledir])}','');"><i class="fa fa-fw fa-clock mr-1"></i>{:lang('v_no_sale_select')}</button>
                                                                    <!-- 软删除 -->
                                                                    <button type="button" class="btn btn-danger" onClick="javascript:do_ajax('#form_list','','{:url('/module/table_update_all_signid',['lang'=>$lang,'signid'=>9,'tabledir'=>$tabledir])}','');"><i class="fa fa-fw fa-trash mr-1"></i>{:lang('v_delete_select')}</button>
                                                            {/switch}
                                                        </div>
                                                    </div>
                                                </div>
                                            </td>
                                        </tr>
                                    </form>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
        <!-- 内容主体 结束 -->
    </div>
    <!-- 右侧 结束 -->
{include file="public/foot" /}
</body>
</html>